package com.company.oa.announcement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.company.oa.announcement.entity.Announcement;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface AnnouncementMapper extends BaseMapper<Announcement> {
    
    IPage<Announcement> selectAnnouncementPage(Page<Announcement> page, @Param("announcement") Announcement announcement);
    
    Announcement selectAnnouncementDetail(@Param("id") Long id);
    
    List<Announcement> selectUserAnnouncements(@Param("userId") Long userId, @Param("departmentId") Long departmentId, @Param("roleIds") List<Long> roleIds);
    
    List<Map<String, Object>> selectAnnouncementStatsByType();
    
    List<Map<String, Object>> selectAnnouncementStatsByDepartment();
    
    List<Map<String, Object>> selectAnnouncementReadStats(@Param("announcementId") Long announcementId);
} 